﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Payroll.BusinessLogic;
using Payroll.BusinessLogic.Audit;
using Payroll.BusinessLogic.Audit.UsersOnline;
using Payroll.BusinessLogic.Configuration.Settings;
using Payroll.BusinessLogic.EmployeeManagement;
using Payroll.BusinessLogic.Directory;
using Payroll.BusinessLogic.Infrastructure;
using Payroll.BusinessLogic.Security;
using Payroll.BusinessLogic.Messages;
using Payroll.Common.Utils;
using Payroll.BusinessLogic.Localization;
using Payroll.BusinessLogic.CustomerManager;
using Payroll.BusinessLogic.MyCompany;
using Payroll.BusinessLogic.Package;
using Payroll.BusinessLogic.Devices;

namespace PayrollHR.Web
{
    public partial class BaseUserControl : UserControl
    {
        protected virtual void BindJQuery()
        {
            
        }
        protected string GetLocaleResourceString(string resourceName)
        {
            Language language = PayrollContext.Current.WorkingLanguage;
            return this.LocalizationManager.GetLocaleResourceString(resourceName, language.LanguageId);
        }

        protected string GetLocaleResourceString(string resourceName, params object[] args)
        {
            Language language = PayrollContext.Current.WorkingLanguage;
            return string.Format(
                this.LocalizationManager.GetLocaleResourceString(resourceName, language.LanguageId),
                args);
        }

        #region Services, managers

        public IOnlineUserService OnlineUserService
        {
            get { return IoC.Resolve<IOnlineUserService>(); }
        }
        public ICustomerActivityService CustomerActivityService
        {
            get { return IoC.Resolve<ICustomerActivityService>(); }
        }
        public ILogService LogService
        {
            get { return IoC.Resolve<ILogService>(); }
        }
        public ISearchLogService SearchLogService
        {
            get { return IoC.Resolve<ISearchLogService>(); }
        }
        public ISettingManager SettingManager
        {
            get { return IoC.Resolve<ISettingManager>(); }
        }
        public IEmployeeService EmployeeService
        {
            get { return IoC.Resolve<IEmployeeService>(); }
        }
        public IACLService ACLService
        {
            get { return IoC.Resolve<IACLService>(); }
        }
        public IBlacklistService BlacklistService
        {
            get { return IoC.Resolve<IBlacklistService>(); }
        }
        public ILocalizationManager LocalizationManager
        {
            get { return IoC.Resolve<ILocalizationManager>(); }
        }
        public ILanguageService LanguageService
        {
            get { return IoC.Resolve<ILanguageService>(); }
        }
        public ICustomerService CustomerService
        {
            get { return IoC.Resolve<ICustomerService>(); }
        }
        public IResultService ResultService
        {
            get { return IoC.Resolve<IResultService>(); }
        }
        public IMessageService MessageService
        {
            get { return IoC.Resolve<IMessageService>(); }
        }
        public IPackageService PackageService
        {
            get { return IoC.Resolve<IPackageService>(); }
        }
        public ICompanyService CompanyServices
        {
            get { return IoC.Resolve<ICompanyService>(); }
        }
        public IDeviceService DeviceService
        {
            get { return IoC.Resolve<IDeviceService>(); }
        }
        public IOrderService OrderService
        {
            get { return IoC.Resolve<IOrderService>(); }
        }
        public IVoucherService VoucherService
        {
            get { return IoC.Resolve<IVoucherService>(); }
        }
        #endregion
    }
}